$(function () {
    //表格初始加载
    $('#grid_dlrz').datagrid({
        url:$.webPath() + "/xtgl/dlrz/dlrzList",
        toolbar:"#toolbar_dlrz",
        fitColumns:true,
        singleSelect:true,
        pagination:true,
        pageNumber:1,
        fit:true,
        rownumbers:true,
        striped:true,
        columns:[[
            {field:'dlr_xm', title:'用户姓名', width:50},
            {field:'dlr_zgjg_qc', title:'主管机构', width:100},
            {field:'dlrq_time', title:'登录时间', width:100},
            {field:'dlip', title:'IP地址', width:300},
            {field:'dlmac', title:'MAC地址', width:300},
            {field:'zt', title:'状态', width:50,
                formatter: function (value) {
                    if (value == '1') {
                        return '登录系统';
                    } else if (value == '2') {
                        return '退出系统';
                    }
                }
            }
        ]]
    });
    //**********按钮触发事件**********
    //查询按钮
    $("#btn_dlrz_search").click(function () {
        dlrz_search();
    });
});

//查询登录日志
function dlrz_search() {
    $('#grid_dlrz').datagrid('reload', {
        dlrq:$("#toolbar_dlrz #dlrz_dlrq").datebox("getValue") || '',
        dlrXm:$("#toolbar_dlrz #dlrz_dlr").val()
    });
}